import { definePropType } from './utils';
import { ExtractPropTypes } from 'vue';
import { BasicColumn } from './types/column';
import { DefaultRow } from './types/table';
import { BasicPaginationProps } from './types/pagination';

export const tableProps = {
  /** 数据 */
  data: {
    type: definePropType<DefaultRow[]>([Array]),
    default: () => [],
  },
  /** 表头配置 */
  columns: {
    type: definePropType<BasicColumn<DefaultRow>[]>([Array]),
    default: () => [],
  },
  /** 分页配置 */
  pagination: {
    type: definePropType<BasicPaginationProps | boolean>([Object, Boolean]),
    default: true,
  },
} as const;

export type TableProps = ExtractPropTypes<typeof tableProps>;
